#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_okBt_clicked()
{
    QString data;
    if(ui->checkBox_name->isChecked()){
        data.append(ui->lineEdit_name->text());  //追加姓名
    }

    if(ui->checkBox_age->isChecked()){
        data.append("-").append(ui->lineEdit_age->text());
    }

    if(ui->checkBox_tel->isChecked()){
        data.append("-").append(ui->lineEdit_del->text());
    }

    if(ui->radioButton_m->isChecked()){
        data.append("-").append("男");
    }else{
        data.append("-").append("女");
    }

    //设置显示
    ui->label->setText(data);

}
